Namespace Seguridad
Public Class Usuario
	Inherits Auditoria.Transaccion

	Private vUsuarioId As Integer = -1
	Private vPersonaID As Integer = -1
        Private vPersonaNombre As String = ""
        Private vLogin As String = ""
        Private vPassword As String = ""
        Private vEstado As Boolean = False
        Private vRolId As Integer = -1
        Private vRolNombre As String = ""
        Private v_Usu_Cre As Integer = -1
        Private v_Fec_Cre As Integer = -1
        Private v_Usu_Mod As Integer = -1
        Private v_Fec_Mod As Integer = -1
        Private v_flg_eli As Boolean = False


        Public Property Conectado As Boolean = False

        Public Property UsuarioId() As Integer
            Get
                Return vUsuarioId
            End Get
            Set(ByVal Value As Integer)
                vUsuarioId = Value
            End Set
        End Property

        Public Property PersonaID() As Integer
            Get
                Return vPersonaID
            End Get
            Set(ByVal Value As Integer)
                vPersonaID = Value
            End Set
        End Property

        Public Property PersonaNombre() As String
            Get
                Return vPersonaNombre
            End Get
            Set(ByVal Value As String)
                vPersonaNombre = Value
            End Set
        End Property

        Public Property Login() As String
            Get
                Return vLogin
            End Get
            Set(ByVal Value As String)
                vLogin = Value
            End Set
        End Property

        Public Property Password() As String
            Get
                Return vPassword
            End Get
            Set(ByVal Value As String)
                vPassword = Value
            End Set
        End Property

        Public Property Estado() As Boolean
            Get
                Return vEstado
            End Get
            Set(ByVal Value As Boolean)
                vEstado = Value
            End Set
        End Property

        Public Property RolId() As Integer
            Get
                Return vRolId
            End Get
            Set(ByVal Value As Integer)
                vRolId = Value
            End Set
        End Property

        Public Property RolNombre() As String
            Get
                Return vRolNombre
            End Get
            Set(ByVal Value As String)
                vRolNombre = Value
            End Set
        End Property

        Public Property _Usu_Cre() As Integer
            Get
                Return v_Usu_Cre
            End Get
            Set(ByVal Value As Integer)
                v_Usu_Cre = Value
            End Set
        End Property

        Public Property _Fec_Cre() As Integer
            Get
                Return v_Fec_Cre
            End Get
            Set(ByVal Value As Integer)
                v_Fec_Cre = Value
            End Set
        End Property

        Public Property _Usu_Mod() As Integer
            Get
                Return v_Usu_Mod
            End Get
            Set(ByVal Value As Integer)
                v_Usu_Mod = Value
            End Set
        End Property

        Public Property _Fec_Mod() As Integer
            Get
                Return v_Fec_Mod
            End Get
            Set(ByVal Value As Integer)
                v_Fec_Mod = Value
            End Set
        End Property

        Public Property _flg_eli() As Boolean
            Get
                Return v_flg_eli
            End Get
            Set(ByVal Value As Boolean)
                v_flg_eli = Value
            End Set
        End Property

	Sub New()
	End Sub

	Sub New(ByRef UsuarioId As Integer, ByVal PersonaID As Integer, ByVal Login As String, ByVal Password As String, ByVal Estado As Boolean, ByVal RolId As Integer, ByVal _Usu_Cre As Integer, ByVal _Fec_Cre As Integer, ByVal _Usu_Mod As Integer, ByVal _Fec_Mod As Integer, ByVal _flg_eli As Boolean)
		vUsuarioId = UsuarioId
		vPersonaID = PersonaID
		vLogin = Login
		vPassword = Password
		vEstado = Estado
		vRolId = RolId
		v_Usu_Cre = _Usu_Cre
		v_Fec_Cre = _Fec_Cre
		v_Usu_Mod = _Usu_Mod
		v_Fec_Mod = _Fec_Mod
		v_flg_eli = _flg_eli
	End Sub

End Class



 Public Class UsuarioCol   
 Inherits System.Collections.CollectionBase
Private _enmSortDirection As SortDirection
Public Sub New()
_enmSortDirection = SortDirection.Asc
End Sub
Public Sub Sort(ByVal sortExpression As String, ByVal sortDirection As SortDirection)
InnerList.Sort(New Comparer(sortExpression, SortDirection))
End Sub
Public Sub Sort(ByVal sortExpression As String)
InnerList.Sort(New Comparer(sortExpression, _enmSortDirection))
If _enmSortDirection = SortDirection.Asc Then
_enmSortDirection = SortDirection.Desc
Else
_enmSortDirection = SortDirection.Asc
End If
End Sub
Public Function Add(ByVal obj As Usuario) As Integer
Return MyBase.List.Add(obj)
End Function
Public ReadOnly Property Usuario(ByVal Index As Integer) As Usuario
Get
Return CType(MyBase.List(Index), Usuario)
End Get
End Property
End Class
end namespace

